package com.yd.app.mapper.provider;

import com.yd.domain.business.ShoppingCart;

import java.util.Map;

/**
 * Created by bxd on 2018/3/21.
 */
public class CartProvider {
    /**
     * 获取每一页列表
     * @param map
     * @return
     */
    public String searchListCart(Map map) {
        ShoppingCart shoppingCart = (ShoppingCart) map.get("shoppingCart");
        StringBuilder stringBuilder = new StringBuilder("select * from business_shopping_cart where 1 = 1");
        stringBuilder.append(" limit #{startRow}, #{pageSize}");
        return stringBuilder.toString();
    }

    /**
     * 获取查询总数量
     * @param map
     * @return
     */
    public String getCartListCount(Map map) {
        ShoppingCart shoppingCart = (ShoppingCart) map.get("shoppingCart");
        StringBuilder stringBuilder = new StringBuilder("select count(1) from business_shopping_cart where 1 = 1");
        return stringBuilder.toString();
    }

    /**
     * 拼装查询条件
     * @param agreement
     * @return
     */
}
